home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / mac / prime_CD / pb / basecast.cst / 00005_Script_init global script < prev    next >
Text File  |  1997-07-24  |  5KB  |  195 lines

  1. global pmroll_list, the_leaf, the_erarolls, current_pm, demo
  2.  
  3. on depth_check
  4.   if the colordepth <> 8 then 
  5.     alert "this application performs best when your computer is set to display 256 colours."
  6.     --    quit
  7.   end if
  8. end
  9.  
  10. on palfix_init
  11.   global fixpal
  12.   openxlib "FixPalet"
  13.   set fixpal=FixPalette(mNew, the stageLeft, the stageTop, the stageRight, the stageTop)
  14. end
  15.  
  16.  
  17. on patchpal
  18.   global fixpal
  19.   if objectp(fixpal) then fixpal(mPatchIt)
  20. end patchpal
  21.  
  22. on palfix_stop
  23.   global fixpal
  24.   if objectp(fixpal) then
  25.     fixpal(mDispose)
  26.   end if
  27.   closeXlib "FixPalet"
  28. end stopmovie
  29.  
  30. on archive_check
  31.   global media_displayed
  32.   if the movie contains "archive" then 
  33.     hide_media(media_displayed)
  34.     puppets_off 
  35.   end if
  36.   unload
  37. end
  38.  
  39. on dopmtop
  40.   unload
  41.   if the movie = "profile.dir" then
  42.     if the colordepth > 8 then puppettransition 51,02,08
  43.     pm_prep(0)
  44.     --    go to "pmtop"  
  45.   else 
  46.     archive_check
  47.     --    if the colordepth > 8 then puppettransition 51,02,08
  48.     --    sound stop 1
  49.     --    go to "fadeout"
  50.     --    set the castnum of sprite 1 to cast "load_pro"
  51.     --    updatestage
  52.     
  53.     --    sound playfile 1, "00prf.aif"
  54.     pm_prep(0)
  55.     --    go to movie fullpathfor("profile.dir") -- kf prs 11/20/96
  56.     --    if current_pm = 0 then
  57.     --    else
  58.     --      pm_prep(current_pm)
  59.     --    end if
  60.   end if
  61. end
  62.  
  63.  
  64. on doarchive
  65.   if the movie <> "archive.dir"  then 
  66.     if the colordepth > 8 then puppettransition 51,02,08
  67.     if the movie contains "_" then 
  68.       go to marker("fadeout") + 1
  69.     else
  70.       go to "fadeout"
  71.     end if
  72.     set the castnum of sprite 1 to cast "load_arch"
  73.     updatestage
  74.     
  75.     --    if the colordepth > 8 then puppettransition 51,02,08
  76.     go to movie fullpathfor("archive.dir") -- kf prs 11/20/96
  77.   end if
  78. end
  79.  
  80.  
  81.  
  82. on startmovie_xxxxxx
  83.   if the moviename = "menu.dir" then
  84.     --  depth_check
  85.     set the searchpath = []
  86.     put the moviepath into mp
  87.     set s = mp&"snd"
  88.     set m = mp&"moovs"
  89.     set gr = mp&"gfx"
  90.     
  91.     -- eras path
  92.     set er = mp&"Eras"
  93.     
  94.     -- archive path
  95.     set ap = mp & "ARCHIVE"
  96.     if the machinetype < 256 then set sep = ":"
  97.     if the machinetype = 256 then set sep = "\"
  98.     set sap = ap & sep & "SOUND"
  99.     set vap = ap & sep & "VIDEO"
  100.     set pap = ap & sep & "PICT"
  101.     set oap = ap & sep & "OTHER"
  102.     set xap = ap & sep & "XOBJ"
  103.     
  104.     set  the searchPath = [ mp,s,m,gr,er]
  105.     
  106.     
  107.     put the searchpath into field "path"
  108.     
  109.     --  if the machinetype < 256 then dobackdrop
  110.     
  111.     makemenurolls
  112.   end if
  113.   
  114. end
  115.  
  116. on makemenurolls
  117.   set pmroll_list = []
  118.   set pmroll_list = [rect(115, 98, 160, 142), rect(163, 98, 208, 142), rect(211, 98, 256, 142), rect(259, 98, 304, 142), rect(307, 98, 351, 142), rect(115, 145, 160, 190), rect(163, 145, 208, 190), rect(211, 145, 256, 190), rect(259, 145, 304, 191), rect(307, 145, 351, 190), rect(115, 193, 160, 239), rect(163, 193, 208, 239), rect(211, 193, 256, 239), rect(259, 193, 304, 239), rect(307, 193, 351, 239), rect(115, 242, 160, 286), rect(163, 242, 208, 286), rect(211, 242, 256, 286), rect(259, 242, 304, 286), rect(307, 242, 351, 286)]
  119.   
  120.   set the_leaf = []
  121.   set the_leaf = [rect(1, 39, 113, 68), rect(1, 67, 113, 96),  rect(1, 95, 113, 124), rect(1, 123, 113, 152), rect(4, 154, 110, 177), rect(4, 182, 110, 205), rect(1, 207, 113, 236), rect(4, 238, 110, 261)]
  122.   
  123.   
  124.   set the_erarolls = []
  125.   set the_erarolls = [rect(113, 95 + 27, 191, 180 + 27), rect(176, 95 + 27, 269, 180 + 27), rect(252, 95 + 27, 341, 180 + 27), rect(321, 95 + 27, 411, 180 + 27), rect(397, 95 + 27, 475, 180 + 27), rect(456, 95 + 27, 530, 180 + 27), rect(515, 95 + 27, 577, 180 + 27)]
  126.   
  127. end
  128.  
  129. on xdobackdrop
  130.   global bg  --global variable for our Backdrop instance
  131.   global printer
  132.   
  133.   --only instantiate the backdrop once!
  134.   --creating multiple instances of
  135.   --the backdrop XObject is dangerous!
  136.   
  137.   if objectp(bg)=0 then
  138.     
  139.     --I like to keep xobjects in separate 'XOBJ' files
  140.     --in the same folder as the movie
  141.     --and open the xobject files only when I
  142.     --need to instantiate the XObject
  143.     
  144.     openxlib "backdrop xobj"
  145.     put backdrop(mNew) into bg
  146.     
  147.     --Then I close the file as soon as I'm done
  148.     --to avoid having lots of open files connected
  149.     --to a movie.
  150.     
  151.     closexlib "backdrop xobj"
  152.     
  153.   end if
  154.   
  155.   if objectp(bg) then
  156.     
  157.     --set whether the backdrop hides
  158.     --when we switch to another application
  159.     --(this should be set to match the movie preference
  160.     --"animate in background")
  161.     
  162.     bg (mHideInBack,false)
  163.     
  164.     --set the color of the backdrop
  165.     if the colordepth = 8 then  bg(mSetColor,255)
  166.     else bg(mSetColor, 0)
  167.     
  168.     --show the backdrop while the movie plays
  169.     bg(mShow)
  170.     
  171.   end if
  172.   
  173.   
  174. end
  175.  
  176.  
  177. on closebackdrop
  178.   global bg, printer
  179.   
  180.   --hide the backdrop when the movie's not playing
  181.   --(you don't have to do this if you like to keep the backdrop
  182.   --there while you work on a movie)
  183.   
  184.   if objectp(bg) then bg(mHide)
  185.   
  186. end
  187.  
  188. on addtohistory tf
  189.   global nav_history
  190.   if not listP(nav_history) then set nav_history = []
  191.   append nav_history,tf  
  192. end
  193.  
  194.  
  195.